#include<bits/stdc++.h>
using namespace std;

int main()
{
	freopen("data.in","w",stdout);
	srand(time(0));
	int n=rand()%3+1;
	int m=rand()%(n*(n+1)/2)+1;
	cout<<n<<" "<<m<<endl;
	for(int i=1; i<=n; ++i)
	{
		for(int j=1; j<=n+1-i; ++j)
		{
			int a=rand();
			cout<<a%10+1<<" ";
		}
		cout<<endl;
	}
	return 0;
}
